package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:56
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemRoleModuleRelate implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.system.dao.ISysRoleModuleRelateDAO.Id);

        mappedDaoFields.put("moduleId",
            com.ourteam.system.dao.ISysRoleModuleRelateDAO.ModuleId);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysRoleModuleRelateDAO.Remarks);

        mappedDaoFields.put("roleId",
            com.ourteam.system.dao.ISysRoleModuleRelateDAO.RoleId);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysRoleModuleRelateDAO.Status);

        mappedDaoFields.put("domainCode",
            com.ourteam.system.dao.ISysRoleModuleRelateDAO.DomainCode);

        mappedDaoFields.put("moduleCode",
            com.ourteam.system.dao.ISysRoleModuleRelateDAO.ModuleCode);
    }

    private com.ourteam.system.dao.SysRoleModuleRelate sysRoleModuleRelate;

    public SystemRoleModuleRelate() {
        super();

        this.sysRoleModuleRelate = new com.ourteam.system.dao.SysRoleModuleRelate();
    }

    public SystemRoleModuleRelate(
        com.ourteam.system.dao.SysRoleModuleRelate sysRoleModuleRelate) {
        super();

        this.sysRoleModuleRelate = sysRoleModuleRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysRoleModuleRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysRoleModuleRelate convertToSysRoleModuleRelate() {
        return this.sysRoleModuleRelate;
    }

    public com.ourteam.system.dao.SysRoleModuleRelate convertTo() {
        return this.sysRoleModuleRelate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysRoleModuleRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysRoleModuleRelate.setId(id);
    }

    /**
     * Get moduleId
     *
     * @return long
     */
    public long getModuleId() {
        return (long) this.sysRoleModuleRelate.getModuleId();
    }

    /**
     * Set moduleId
     *
     * @parameter long
     */
    public void setModuleId(long moduleId) {
        this.sysRoleModuleRelate.setModuleId(moduleId);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysRoleModuleRelate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysRoleModuleRelate.setRemarks(remarks);
    }

    /**
     * Get roleId
     *
     * @return long
     */
    public long getRoleId() {
        return (long) this.sysRoleModuleRelate.getRoleId();
    }

    /**
     * Set roleId
     *
     * @parameter long
     */
    public void setRoleId(long roleId) {
        this.sysRoleModuleRelate.setRoleId(roleId);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysRoleModuleRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysRoleModuleRelate.setStatus(status);
    }

    /**
     * Get domainCode
     *
     * @return String
     */
    public String getDomainCode() {
        return (String) this.sysRoleModuleRelate.getDomainCode();
    }

    /**
     * Get moduleCode
     *
     * @return String
     */
    public String getModuleCode() {
        return (String) this.sysRoleModuleRelate.getModuleCode();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemRoleModuleRelate) == false) {
            return false;
        } // end if

        SystemRoleModuleRelate other = (SystemRoleModuleRelate) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysRoleModuleRelate tempSysRoleModuleRelate = other.convertToSysRoleModuleRelate();

        if ((tempSysRoleModuleRelate == null) ||
                (this.sysRoleModuleRelate == null)) {
            isEqual = false;
        } else if ((tempSysRoleModuleRelate == this.sysRoleModuleRelate) ||
                tempSysRoleModuleRelate.equals(this.sysRoleModuleRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemRoleModuleRelate[] toArray(
        com.ourteam.system.dao.SysRoleModuleRelate[] aSysRoleModuleRelates) {
        return toArray(aSysRoleModuleRelates, null);
    }

    public static SystemRoleModuleRelate[] toArray(
        com.ourteam.system.dao.SysRoleModuleRelate[] aSysRoleModuleRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysRoleModuleRelates)) {
            return new SystemRoleModuleRelate[0];
        }

        int length = aSysRoleModuleRelates.length;

        SystemRoleModuleRelate[] beans = new SystemRoleModuleRelate[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemRoleModuleRelate(aSysRoleModuleRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aSysRoleModuleRelates[i] });
            }
        }

        return beans;
    }
}
